package base;

import org.junit.Test;

/**
 * @author lwmzzz
 * @version 1.0
 * @date 2021/3/28 14:47
 * @description 测试finally
 */
public class FinallyTest {
    @Test
    public void test1() {
        int i = 2;
        try {
            i = 3;
            System.out.println(i);
        } catch (Exception e) {
            i = 4;
        } finally {
            i = 5;
        }

    }
    @Test
    public void test2(){
        String a = "a";
        try {
            a= "dsadsa";

        }catch (Exception e){
            a=a+"123";
        }finally {
            a = a+"finally";
        }
        System.out.println(a);
    }
}
